<template>
	<view class="list">
		<view class="list_item" v-for="(item,index) in dataList" :key="index" @click="goDetail(item)">
			<view class="img">
				<view>
					<text class="sign">￥</text>
					<text class="num">{{item.price}}</text>
				</view>
			</view>
			<view class="cont">
				<div class="cont_l">
					<view class="name u-line-2">{{item.name}}</view>
					<view class="time">{{item.start_date | formatTime()}}-{{item.end_date | formatTime()}}</view>
				</div>
				<image class="cont_go" src="../../static/go.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		formatDate
	} from '@/utils/moment/index.js';
	export default {
		props: {
			parameter: {
				type: Object,
				default: () => {
					return {};
				}
			},
			dataList: {
				type: Array,
				default: []
			}
		},
		filters: {
			formatTime(val) {
				return formatDate(val, 'YYYY-MM-DD');
			}
		},
		data() {
			return {};
		},
		mounted() {},
		methods: {
			goDetail(item) {
				this.$linkTo(`/package/distribution/coupon/packageDetail?id=${item.pk_id}`)
			}
		},
	};
</script>

<style scoped lang="scss">
	.list {
		padding: 10rpx 26rpx;

		.list_item {
			margin-bottom: 30rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			display: flex;

			.img {
				margin-right: 24rpx;
				background-image: url(../../static/coupon.png);
				width: 220rpx;
				height: 190rpx;
				background-size: 100% 100%;
				color: #fff;
				display: flex;
				align-items: center;
				justify-content: center;

				.sign {
					font-size: 30rpx;
				}

				.num {
					font-size: 56rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FFFFFF;
				}
			}

			.cont {
				flex: 1;
				overflow: hidden;
				display: flex;
				align-items: center;
				padding-right: 36rpx;

				.cont_l {
					flex: 1;
					overflow: hidden;

					.name {
						font-size: 30rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #000000;
					}

					.time {
						margin-top: 10rpx;
						padding-bottom: 40rpx;
						font-size: 24rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #999999;
					}
				}

				.cont_go {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
				}
			}
		}
	}
</style>
